BIN=bin
SOURCE=src
BUILD=build
CGI_EXECUTABLES=$(BIN)/papers.cgi $(BIN)/paperview.cgi $(BIN)/paperload.cgi $(BIN)/cgitest.cgi
COMMON_OBJECTS=$(BUILD)/html_utils.o $(BUILD)/strings.o $(BUILD)/parsing.o

CC=gcc
LINKER=gcc
COPTS=-Wall
LOPTS=-Wall


all: $(CGI_EXECUTABLES)

$(BIN)/%.cgi: $(BUILD)/%.o $(COMMON_OBJECTS)
	$(LINKER) $(LOPTS) $^  -o $@

$(BUILD)/%.o: $(SOURCE)/%.c
	$(CC) $(COPTS) -c $^ -o $@

clean:
	rm -fr $(CGI_EXECUTABLES)
